//
//  main.cpp
//  HJ1 字符串中最后一个单词的长度
//
//  Created by Yan Zihao on 2024/9/28.
//

#include <iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(void)
{
    string s;
    string answer;
    int count = 0;
    getline(cin,s);
    int i = s.size() - 1;
    while((s[i] > 'a' && s[i] < 'z') || (s[i] > 'A' && s[i] < 'Z'))
    {
        answer.push_back(s[i]);
        count++;
        i--;
    }
    /*reverse(answer.begin(),answer.end());
    cout << answer <<endl;
    return 0;*/
    cout << count <<endl;
    return 0;
}
